package cn.zorbus.laian.infrastructure.config;

import cn.zorbus.laian.domain.entity.SwitchEntity;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import java.util.List;

import static cn.zorbus.laian.infrastructure.common.Switch.DEFAULT_TYPE;
import static cn.zorbus.laian.infrastructure.common.Switch.LIGHT_TYPE;
import static cn.zorbus.laian.infrastructure.common.Switch.SCREEN_TYPE;

/**
 * create in 2023/02/4 02:27
 *
 * @author shishaodong
 * @version 0.0.0
 */
@Data
@Validated
@Component
@ConfigurationProperties(prefix = "cn.zorbus.light")
public class SwitchProperties {

    private Long delay = 120L;

    private List<SwitchEntity> items = List.of(
            new SwitchEntity(1, "一键开馆", 1, DEFAULT_TYPE, List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16)),
            new SwitchEntity(2, "一键闭馆", 0, DEFAULT_TYPE, List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16)),

            new SwitchEntity(3, "一键开灯", 1, DEFAULT_TYPE, List.of(1, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 16)),
            new SwitchEntity(4, "一键关灯", 0, DEFAULT_TYPE, List.of(1, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 16)),

            new SwitchEntity(5, "一键开屏", 1, DEFAULT_TYPE, List.of(2, 5, 11)),
            new SwitchEntity(6, "一键关屏", 0, DEFAULT_TYPE, List.of(2, 5, 11)),

            new SwitchEntity(11, "大厅吊灯", 1, LIGHT_TYPE, List.of(3, 6, 9, 14)),
            new SwitchEntity(12, "边厅吊灯", 1, LIGHT_TYPE, List.of(4)),
            new SwitchEntity(13, "走廊吊灯", 1, LIGHT_TYPE, List.of(13)),
            new SwitchEntity(14, "氛围灯", 1, LIGHT_TYPE, List.of(1, 7, 8, 10, 12, 16)),

            new SwitchEntity(15, "LED 屏", 1, SCREEN_TYPE, List.of(2)),
            new SwitchEntity(16, "大厅电视", 1, SCREEN_TYPE, List.of(11)),
            new SwitchEntity(17, "边厅电视", 1, SCREEN_TYPE, List.of(5))
    );

}
